package com.my.chapter8;

public class practice1 {
    public static void ride(Cycle c){
        c.ride();
    }
    public static void main(String[] args) {
        Unicycle u = new Unicycle();
        Bicycle b = new Bicycle();
        Tricycle t = new Tricycle();
        u.ride();
        b.ride();
        t.ride();
    }
}

class Cycle{
    public void ride(){
        System.out.println("Cycle.ride()");
    }
}

class Unicycle extends Cycle{
    public void ride(){
        System.out.println("Unicycle.ride()");
    }
}

class Bicycle extends Cycle{
    public void ride(){
        System.out.println("Bicycle.ride()");
    }
}

class Tricycle extends Cycle{
    public void ride(){
        System.out.println("Tricycle.ride()");
    }
}


